import json

ctx = """
    {
    "tool_calls": [
        {
            "name": "generate_uml",
            "parameters": {
                "uml_type": "由于主题和内容信息过于简略，难以明确合适的UML图类型，暂无法确定",
                "plantuml_content": "因信息不足，无法生成有效的PlantUML内容"
            }
        }
    ]
}

        """
jst = json.loads(ctx)
cont = jst['tool_calls'][0]['parameters']['plantuml_content']

start = cont.index('@startuml')
end = cont.index('@enduml')
cc = cont[start:end] + '@enduml'
cc = cc.replace(r'\n', '\n')

cc = cc.replace(
                r'!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/dist/c4_umbrella.puml', '')
cc = cc.replace(r'\"', '"')